How to loop over an Array from an API where some properties has null as value without modifying it